home *** CD-ROM | disk | FTP | other *** search
- /* bioskey.c --- p568 */
- #include <stdio.h>
- #include <bios.h>
- #define KEYBRD_READY 1
- #define KEYBRD_READ 0
- main()
- {
- unsigned count = 0, c = 0;
- while(count < 5000)
- {
- if(bioskey(KEYBRD_READY))
- {
- /* read keystroke & mask out high byte */
- c = bioskey(KEYBRD_READ) & 0xff;
- printf("You entered: %c\n", c);
- break;
- }
- count++;
- }
- printf("Count is: %u\n", count);
- }